The Gray Council classes implement the "Apple Grayscale Appearance" for System 7. Apple has published the visual specifications for grayscale user interface components under System 7 that are consistent with the Copland (MacOS 8) default Apple appearance. But there is a lot work to actually implement these specifications; that's what the Gray Council does for you by providing a complete set of core C++ classes that implement the AGA, plus a set of "adapter" classes for MacApp and PowerPlant programmers.
The core Gray Council classes are provided in GrayCouncil.cpp and GrayCouncil.h. These classes are not framework-specific. In addition to implementing the complete set of Apple Grayscale Appearance controls, the Gray Council classes provide several additional features that you can take advantage of, or ignore:
- Automatic radio button group mutually exclusive behavior.
- "Live" scrolling; turned on by default.
- Proportional scroll bars; turned off by default.
- Icon buttons with dual-state icons.
- Text style support for non-system font controls.
- Script Manager support for system justification.
- Left- and right-justified sliders.
- "Moving origin" for determinate progress indicators.
In addition to the core Gray Council classes, there are MacApp and PowerPlant adapter classes:
- The MacApp adapter classes are provided in GrayCouncilMA.cpp and GrayCouncilMA.h. These classes provide drop-in MacApp view and adorner subclasses that interface with the core classes. For MacApp users, this means you can for the most part add the Apple Grayscale Appearance by simply changing subview class names in your view resources. There is a separate information file for the MacApp adapter classes, and there is a MacApp 3.3-based sample/test application in the projects folder.
- The PowerPlant adapter classes are provided in GrayCouncilPP.cpp and GrayCouncilPP.h. These classes provide drop-in PowerPlant pane and attachment subclasses that interface with the core classes. For PowerPlant users, this means you can for the most part add the Apple Grayscale Appearance by simply changing pane class IDs in your view resources. There is a separate information file for the PowerPlant adapter classes, and there is a PowerPlant 1.4-based sample/test application in the projects folder.
Planned for Gray Council release 1.2 is the addition of Dialog Manager adapter classes and a folder tabs control.
Please read the licensing requirements section below.
Overview of the Gray Council Core classes.
These are the AGA classes that you'll be using for the most part. See GrayCouncil.h for usage instructions. If you are using the MacApp or PowerPlant adapter classes, you will probably not instantiate core class objects directly.
AGAPushButton
Standard push button control, with optional default button outline.
AGACheckBox
Standard check box control, with mixed-state capability.
AGARadioButton
Standard radio button control, with mixed-state capability.
AGAIconPushButton
Standard icon button control, with push button behavior.
AGAIconCheckBox
Standard icon button control, with check box behavior.
AGAIconRadioButton
Standard icon button control, with radio button behavior.
AGAScrollBar
Standard scroll bar control, with options for live scrolling and proportional thumb.
AGASlider
Standard slider control, labeled or unlabeled, with options for live tracking and proportional indicator.
AGAPopupMenu
Standard popup menu control, with choice of horizontal resizing behavior.
AGALittleArrows
Standard little arrows control.
AGADisclosureTriangle
Standard disclosure triangle, with automatic animation.
AGAProgressIndicator
Standard determinate and indeterminate progress indicators, with option for moving determinate origin.
AGASeparator
Standard separator line.
AGAGroupBox
Standard primary and secondary group boxes, with or without a title, or with gap for separate title object.
Compatibility.
The Gray Council classes require Color QuickDraw, and support multiple screen devices including 1-bit drawing and spanning.
Version 1.1 has been tested using CodeWarrior 9 compiling for 68K and PowerPC, using the supplied MacApp and PowerPlant test programs. The MacApp test program uses application main and resource file names as expected by the MPW MABuild tool, although I have only built it with CodeWarrior.
Change History.
1.1, August 9 1996.
• Implements PowerPlant adapter classes.
• Implements the following changes and bug fixes:
- Made offscreen image RGB bit manipulation OK for 2-byte int builds (as in PowerPlant project stationery).
- Made AGAStringOut force text mode to srcOr so as not to erase background in PowerPlant drawing environment.
- Moved window background drawing from MacApp adorners to core AGA function call.
- Added two #pragma segment directives to GrayCouncil.cpp because the core segment size was too big for the PowerPlant project stationery's default code model settings.
- Bug fix: AGALittleArrows::mNotificationRoutine was not inited to NULL!
- Bug fix: variable-width menu sizing was using a Max calc instead of Min.
- Bug fix: popup label was too close to popup (MacApp demo had somehow gotten trailing spaces in the labels to hide the error). Now inset label box right by 3.
- Bug fix: the indeterminate progress indicator's GDIterator was being destructed after restoring the clip, causing clipping problem with multi-screen drawing in PowerPlant drawing environment.
- Made core draw routines set up pen completely before drawing. There are too many framework-dependent drawing environment differences to assume anything.
- Implemented window/dialog background shading contoured around grow box. The test apps now use a resizeable main window to demonstrate this.
- Bug fix: bottom right edge pixels needed to be redrawn to handle resizeable windows. The adapter classes now override the necessary window resize functions to catch this and redraw as necessary. The test apps now use a resizeable main window to demonstrate this.
For commercial or in-house developer use, you must register Gray Council. Hey, it's dirt cheap. If you have several developers using the Gray Council code, you should register a site license, which is also dirt cheap.
You may modify this code for your own purposes, but you may not redistribute modified versions of this code.
Registration is done using the Kagi Shareware service—use the supplied Register application if you are registering. With your registration, please note the name of your application.
If you have any questions about licensing, e-mail me.
Using the Register program.
[ Below are the instructions from Kagi on using the shareware registration program. ]
Open the Register program. Enter your name, your email address, and the number of single user licenses you desire for each program you wish to purchase (or Site or Word-Wide licenses). Save or Copy or Print the data from the Register program and send the data and payment to Kagi. More specifics on the Register program to follow. Kagi handles the payment processing.
If paying with Credit Card or First Virtual, you can email or fax the data to Kagi. Their email address is sales@kagi.com and their fax number is +1 510 652-6589. You can either Copy the data from Register and paste into the body of an email message or you can Save the data to a file and you can attach that file to an email message. There is no need to compress the data file, it's already pretty small. If you have a fax modem, just Print the data to the Kagi fax number.
Payments sent via email are processed within 3 to 4 days. You will receive an email acknowledgement when it is processed. Payments sent via fax take up to 10 days and if you provide a correct internet email address you will receive an email acknowledgement.
If you are paying with Cash or USD Check you should print the data using the Register application and send it to the address shown on the form, which is:
Kagi
1442-A Walnut Street #392-TI
Berkeley, California 94709-1405
USA
You can pay with a wide variety of cash from different countries but at present if you pay via check, it must be a check drawn in US Dollars. Kagi cannot accept checks in other currencies, the conversion rate for non-USD checks is around USD 15 per check and that is just not practical. If you have a purchasing department, you can enter all the data into the Register program and then select Invoice as your payment method. Print three copies of the form and send it to your accounts payable people. You might want to highlight the line that mentions that they must include a copy of the form with their payment.
Kagi can not invoice your company, you need to act on my behalf and generate the invoice and handle all the paperwork on your end. Please do not fax or email payment forms that indicate Cash, Check or Invoice as the payment method. As far as we know, there is still no technology to transfer physical objects via fax or email and without the payment, the form cannot be processed. Payments send via postal mail take time to reach Kagi and then up to 10 days for processing. Again, if you include a correct email address, you will hear from Kagi when the form is processed.